package com.Lacia.emsserver.constant;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Albert Chen
 */
public final class TopicEmsConst {

    // myAir 自定义空调topic
    public static final String MY_AIR_CONDITION_DATA = "my/air/condition";
    // 自定义pcs数据
    public static final String MY_PCS_PUSH_DATA = "my/pcs/push1";
    // 自定义bms电池堆数据
    public static final String MY_BMS_STACK_DATA = "my/bms/stack";
    // 自定义bms电池簇数据
    public static final String MY_BMS_CLUSTER_DATA = "my/bms/cluster";
    // 自定义bms电池簇单体数据
    public static final String MY_BMS_CLUSTER_MONOMER_DATA = "my/bms/cluster/monomer";
    // 自定义液冷数据
    public static final String MY_LIQCOOL_DATA = "my/air/liqcool";
    // 自定义计量电表数据
    public static final String MY_METER_DATA = "my/meter/data";





    private static final Set<String> TOPICS = new HashSet<>();
    static {
        Field[] fields = TopicEmsConst.class.getDeclaredFields();
        for (Field field : fields) {
            try {
                Object val = field.get(null);
                if (val instanceof String s) {
                    TOPICS.add(s);
                }
            } catch (IllegalAccessException ignore) {}
        }
    }
    public static Set<String> topics() {
        return TOPICS;
    }
}
